/*
 * {comment of class}
 *
 * @author (C) <a href="http://www.carfield.com.hk">Carfield Yim</a>, 2005
 */
package hk.com.carfield.item;

import hk.com.carfield.core.ContentManager;
import hk.com.carfield.core.Context;

import java.io.File;
import java.io.IOException;

public final class HeadItem extends FileItem {
	final String desc;
	public HeadItem(final Context c, final File f) throws IOException {
		super(c, f, true);
		desc = extendedDesc(c, f);
	}
	public static String extendedDesc(final Context c, final File f) throws IOException {
		//TODO remove hardcode HTML
		return c.persistMan.getWithHtml(f)+"<br/>"+ContentManager.getContent(c, f).getContent() +"<br/>"+ 
		"<script type=\"text/javascript\"><!--"+
		"google_ad_client = \"pub-9426659565807829\";"+
		"google_ad_slot = \"9359905831\";"+
		"google_ad_width = 728;"+
		"google_ad_height = 15;"+
		"//-->"+
		"</script><script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script>";
	}
	public static String extendedDesc(final FileItem item) throws IOException {
		return extendedDesc(item.context, item.file);
	}
	public String getDesc() {
		return desc;
	}
    public final int getOrder() {
        return 0;
    }
}